package com.zhiyou100.abstract_demo2;

/**
 * 卡
 */
public abstract class Card {

    private String card_num;   //卡号
    private String password;   //密码
    private double balance;    //余额

    public Card() {
    }

    public Card(String card_num, String password, double balance) {
        this.card_num = card_num;
        this.password = password;
        this.balance = balance;
    }

    public String getCard_num() {
        return card_num;
    }

    public void setCard_num(String card_num) {
        this.card_num = card_num;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public double getBalance() {
        return balance;
    }

    public void setBalance(double balance) {
        this.balance = balance;
    }

    //充值功能
    public void recharge(double price){
        balance += price;
    }
    //支付功能   根据不同的卡支付打折不一样
    public abstract void pay(double price);

}
